import { ApiTags } from '@nestjs/swagger/dist/decorators';
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { LockServiceService } from './lock-service.service';
import { CreateLockServiceDto } from './dto/create-lock-service.dto';
import { UpdateLockServiceDto } from './dto/update-lock-service.dto';

@ApiTags('锁定服务')
@Controller('lockservice')
export class LockServiceController {
  constructor(private readonly lockServiceService: LockServiceService) {}

  @Post()
  async create(@Body() createLockServiceDto: CreateLockServiceDto) {
    return await this.lockServiceService.create(createLockServiceDto);
  }

  @Get()
  async findAll() {
    return await this.lockServiceService.findAll();
  }

  @Get('page')
  async findPage(@Query() query: any) {
    return await this.lockServiceService.findPage(query)
  }

  @Get(':id')
  async findOne(@Param('id') id: string) {
    return await this.lockServiceService.findOne(id);
  }

  @Patch(':id')
  async update(@Param('id') id: string, @Body() updateLockServiceDto: UpdateLockServiceDto) {
    return await this.lockServiceService.update(id, updateLockServiceDto);
  }

  @Delete(':id')
  async remove(@Param('id') id: string) {
    return await this.lockServiceService.remove(id);
  }

  @Post('delMany')
  manyRemove(@Body() body: string[]) {
    return this.lockServiceService.manyRemove(body)
  }
}
